package org.rency.common.messager.beans;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

/**
 * 发送短信调用平台
 * @author: user_rcy@163.com
 * </br>Created on
 * @version: V1.0.0
 * @since JDK 1.8
 */
public enum SMSPlateform {

    WEBCHINESE("WEBCHINESE","中国网建平台"),
    ALIDAYU("ALIDAYU","阿里大鱼开放服务"),
    ;

    private String code;
    private String message;

    SMSPlateform(String code,String message){
        this.code = code;
        this.message = message;
    }

    public String getCode(){
        return this.code;
    }

    public String getMessage(){
        return this.message;
    }

    public static SMSPlateform getErrorKind(String code){
        for(SMSPlateform error : SMSPlateform.values()){
            if(code.toUpperCase().equals(error.getCode().toUpperCase())){
                return error;
            }
        }
        return null;
    }

    public boolean equals(String code) {
        return getCode().equals(code);
    }

    public String toString(){
        return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
    }
}
